SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for tb_answer
-- ----------------------------
DROP TABLE IF EXISTS `tb_answer`;
CREATE TABLE `tb_answer` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `question_id` int DEFAULT NULL COMMENT '密保问题ID',
  `answer` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密保问题答案',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户密保问题答案表';

-- ----------------------------
-- Records of tb_answer
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tb_benefits
-- ----------------------------
DROP TABLE IF EXISTS `tb_benefits`;
CREATE TABLE `tb_benefits` (
  `benefits_id` bigint NOT NULL AUTO_INCREMENT COMMENT '节日福利编号',
  `benefits_salary` decimal(10,2) DEFAULT NULL COMMENT '福利金额',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `issue_date` datetime DEFAULT NULL COMMENT '福利发放时间',
  `issue_year` int DEFAULT NULL COMMENT '福利发放年',
  `issue_month` int DEFAULT NULL COMMENT '福利发放月',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`benefits_id`) USING BTREE,
  KEY `issue_year` (`issue_year`) USING BTREE COMMENT '福利发放年索引'
) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='节日福利表';

-- ----------------------------
-- Table structure for tb_common
-- ----------------------------
DROP TABLE IF EXISTS `tb_common`;
CREATE TABLE `tb_common` (
  `common_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '手动存入该字段所表示含义',
  `def` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '可为任意值',
  `instruction` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '描述所用字段含义',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`common_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='常量表';

-- ----------------------------
-- Records of tb_common
-- ----------------------------
BEGIN;
INSERT INTO `tb_common` (`common_id`, `def`, `instruction`, `created_time`, `updated_time`) VALUES ('c_nav_sort', '1008', '子导航排序标识', '2019-01-11 13:41:59', '2020-12-14 14:47:26');
INSERT INTO `tb_common` (`common_id`, `def`, `instruction`, `created_time`, `updated_time`) VALUES ('f_nav_sort', '2001', '父导航排序标识', '2019-01-11 13:38:59', '2019-01-21 13:52:52');
COMMIT;

-- ----------------------------
-- Table structure for tb_navigation
-- ----------------------------
DROP TABLE IF EXISTS `tb_navigation`;
CREATE TABLE `tb_navigation` (
  `nav_id` int NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
  `item` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单标题',
  `icon` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单图标',
  `url` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '控制器路径',
  `path` varchar(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '菜单路径',
  `component` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT '组件名称',
  `instruction` tinytext CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '菜单描述',
  `parent_id` int NOT NULL COMMENT '菜单父节点(父节点 0表示根节点)',
  `sort` int NOT NULL COMMENT '排序标识',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`nav_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1012 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='菜单表';

-- ----------------------------
-- Records of tb_navigation
-- ----------------------------
BEGIN;
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1001, '工资管理', 'el-icon-s-management', '/', '/salary', 'Layout', '工资管理', 0, 2001, '2019-01-21 13:52:52', '2019-01-21 13:52:52');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1002, '我的工资', 'el-icon-money', '/salary/my/**', 'mySalary', 'portal/mySalary/index', '显示工资列表', 1001, 1001, '2019-01-21 14:08:09', '2019-02-12 14:19:32');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1003, '历史工资', 'el-icon-time', '/salary/history/**', 'historySalary', 'portal/historySalary/index', '历史工资列表', 1001, 1002, '2019-01-22 10:43:51', '2020-06-09 15:01:23');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1004, '节日福利', 'el-icon-present', '/benefits/**', 'holidayBenefits', 'portal/holidayBenefits/index', '节日福利', 1001, 1003, '2020-07-04 22:12:44', '2020-07-04 22:12:44');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1005, '工资统计', 'el-icon-data-line', '/salary/analyze/**', 'salaryAnalyze', 'portal/salaryAnalyze/index', '以年为单位统计工资收入', 1001, 1004, '2020-06-09 15:01:06', '2020-06-09 15:01:06');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1006, '网站管理', 'international', '/', '/manage', 'Layout', '网站相关功能的管理', 0, 2999, '2019-01-11 13:21:51', '2019-01-11 13:21:51');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1007, '角色管理', 'peoples', '/manage/role/**', 'role', 'manage/role/index', '增删改查系统角色组，除超级管理员外，其余角色只能增删改改角色权限以下的角色', 1006, 1005, '2019-01-17 08:21:54', '2019-01-18 09:58:31');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1008, '权限设置', 'el-icon-s-tools', '/manage/roleSetting/**', 'roleSetting', 'manage/roleSetting/index', '设置比用户权限低的用户的权限，超级管理员可设置所有用户', 1006, 1006, '2019-01-16 23:08:36', '2019-01-18 09:47:12');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1009, '用户管理', 'el-icon-s-custom', '/manage/user/**', 'user', 'manage/user/index', '管理系统用户，除超级管理员外，其余权限仅能管理该权限以下的用户', 1006, 1007, '2019-01-17 08:25:39', '2019-02-12 10:06:27');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1010, '密保模板', 'el-icon-question', '/manage/security/**', 'security', 'manage/security/index', '设置用户注册时安全问题的模板', 1006, 1008, '2020-08-05 11:10:53', '2020-08-05 11:10:53');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1011, '菜单管理', 'tree-table', '/manage/page/**', 'pageSetting', 'manage/pageSetting/index', '页面设置', 1006, 1999, '2019-01-11 14:01:33', '2019-01-18 09:59:12');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1014, '加班管理', 'el-icon-timer', '/', '/workOvertime', 'Layout', '管理加班记录', 0, 2003, '2022-06-09 20:17:18', '2022-06-09 20:17:18');
INSERT INTO `tb_navigation` (`nav_id`, `item`, `icon`, `url`, `path`, `component`, `instruction`, `parent_id`, `sort`, `created_time`, `updated_time`) VALUES (1015, '加班记录', 'el-icon-date', '/workOvertime/record/**', 'record', 'work_overtime/record/index', '查询加班记录、加班签到等操作', 1014, 1009, '2022-06-09 20:22:41', '2022-06-09 20:22:41');
COMMIT;

-- ----------------------------
-- Table structure for tb_question
-- ----------------------------
DROP TABLE IF EXISTS `tb_question`;
CREATE TABLE `tb_question` (
  `question_id` int NOT NULL AUTO_INCREMENT COMMENT '密保ID',
  `question` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密保问题',
  `user_id` bigint DEFAULT NULL COMMENT '创建人ID',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`question_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1007 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='密保模板表';

-- ----------------------------
-- Records of tb_question
-- ----------------------------
BEGIN;
INSERT INTO `tb_question` (`question_id`, `question`, `user_id`, `created_time`, `updated_time`) VALUES (1001, '你第一个宠物的名字是什么？', 1, '2020-08-06 10:28:29', '2020-08-06 10:28:29');
INSERT INTO `tb_question` (`question_id`, `question`, `user_id`, `created_time`, `updated_time`) VALUES (1002, '你出生城市的名称是什么？', 1, '2020-08-06 10:28:44', '2020-08-06 10:28:44');
INSERT INTO `tb_question` (`question_id`, `question`, `user_id`, `created_time`, `updated_time`) VALUES (1003, '你孩童时期的昵称是什么？', 1, '2020-08-06 10:28:58', '2020-08-06 10:28:58');
INSERT INTO `tb_question` (`question_id`, `question`, `user_id`, `created_time`, `updated_time`) VALUES (1004, '你父母相遇的城市的名称是什么？', 1, '2020-08-06 10:29:08', '2020-08-06 10:29:08');
INSERT INTO `tb_question` (`question_id`, `question`, `user_id`, `created_time`, `updated_time`) VALUES (1005, '你年纪最大的表亲的名字是什么？', 1, '2020-08-06 10:29:18', '2020-08-06 10:29:18');
INSERT INTO `tb_question` (`question_id`, `question`, `user_id`, `created_time`, `updated_time`) VALUES (1006, '你的母校名称是什么？', 1, '2020-08-06 10:29:25', '2020-08-06 10:29:25');
COMMIT;

-- ----------------------------
-- Table structure for tb_role
-- ----------------------------
DROP TABLE IF EXISTS `tb_role`;
CREATE TABLE `tb_role` (
  `role_id` int NOT NULL AUTO_INCREMENT COMMENT '权限ID',
  `role_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '权限名称',
  `instruction` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '权限描述',
  `user` varchar(32) CHARACTER SET utf8 DEFAULT NULL COMMENT '创建人',
  `role_security` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'SpringSecurity对应的权限',
  `role_level` int NOT NULL COMMENT '权限级别 0-超级管理员 1-管理员 5-普通用户',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1004 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色表';

-- ----------------------------
-- Records of tb_role
-- ----------------------------
BEGIN;
INSERT INTO `tb_role` (`role_id`, `role_name`, `instruction`, `user`, `role_security`, `role_level`, `created_time`, `updated_time`) VALUES (1001, '超级管理员', '拥有系统最高权限', '超级管理员', 'ROLE_host', 0, '2019-01-11 11:05:03', '2022-02-27 23:40:28');
INSERT INTO `tb_role` (`role_id`, `role_name`, `instruction`, `user`, `role_security`, `role_level`, `created_time`, `updated_time`) VALUES (1002, '管理员', '管理系统日常运行，拥有系统大部分权限', '超级管理员', 'ROLE_admin', 1, '2019-01-18 14:13:31', '2022-02-27 23:48:25');
INSERT INTO `tb_role` (`role_id`, `role_name`, `instruction`, `user`, `role_security`, `role_level`, `created_time`, `updated_time`) VALUES (1003, '普通用户', '注册用户，普通权限', '超级管理员', 'ROLE_common', 5, '2019-01-18 14:22:31', '2022-03-01 20:06:45');
COMMIT;

-- ----------------------------
-- Table structure for tb_role_navigation
-- ----------------------------
DROP TABLE IF EXISTS `tb_role_navigation`;
CREATE TABLE `tb_role_navigation` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `nav_id` int DEFAULT NULL COMMENT '菜单ID',
  `role_id` int DEFAULT NULL COMMENT '角色ID',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `nav_id` (`nav_id`) USING BTREE,
  KEY `role_id` (`role_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1031 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='角色所辖菜单表';

-- ----------------------------
-- Records of tb_role_navigation
-- ----------------------------
BEGIN;
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1001, 1001, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1002, 1002, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1003, 1003, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1004, 1004, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1005, 1005, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1006, 1006, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1007, 1007, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1008, 1008, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1009, 1009, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1010, 1010, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1011, 1011, 1001, '2022-03-09 21:42:45', '2022-03-09 21:42:45');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1110, 1014, 1001, '2022-06-09 20:17:18', '2022-06-09 20:17:18');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1111, 1015, 1001, '2022-06-09 20:22:41', '2022-06-09 20:22:41');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1112, 1001, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1113, 1002, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1114, 1003, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1115, 1004, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1116, 1005, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1117, 1014, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1118, 1015, 1003, '2022-06-09 20:23:36', '2022-06-09 20:23:36');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1119, 1006, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1120, 1001, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1121, 1002, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1122, 1003, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1123, 1004, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1124, 1005, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1125, 1007, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1126, 1008, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1127, 1009, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1128, 1010, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1129, 1014, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
INSERT INTO `tb_role_navigation` (`id`, `nav_id`, `role_id`, `created_time`, `updated_time`) VALUES (1130, 1015, 1002, '2022-06-09 20:23:42', '2022-06-09 20:23:42');
COMMIT;

-- ----------------------------
-- Table structure for tb_salary
-- ----------------------------
DROP TABLE IF EXISTS `tb_salary`;
CREATE TABLE `tb_salary` (
  `salary_id` bigint NOT NULL AUTO_INCREMENT COMMENT '工资ID',
  `salary` decimal(10,2) DEFAULT NULL COMMENT '工资',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `issue_date` datetime DEFAULT NULL COMMENT '工资发放时间',
  `issue_year` int DEFAULT NULL COMMENT '工资发放年',
  `issue_month` int DEFAULT NULL COMMENT '工资发放月',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`salary_id`) USING BTREE,
  KEY `issue_year` (`issue_year`) USING BTREE,
  KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='工资表';

-- ----------------------------
-- Table structure for tb_user
-- ----------------------------
DROP TABLE IF EXISTS `tb_user`;
CREATE TABLE `tb_user` (
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户密码',
  `real_name` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '姓名',
  `phone` char(11) CHARACTER SET utf8 DEFAULT NULL COMMENT '手机号码',
  `gender` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性别',
  `age` int DEFAULT NULL COMMENT '年龄',
  `role_id` int DEFAULT NULL COMMENT '角色ID',
  `login_time` datetime DEFAULT NULL COMMENT '登录时间',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`user_id`) USING BTREE,
  KEY `user_ibfk_1` (`role_id`) USING BTREE,
  CONSTRAINT `tb_user_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `tb_role` (`role_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户表';

-- ----------------------------
-- Records of tb_user
-- ----------------------------
BEGIN;
INSERT INTO `tb_user` (`user_id`, `username`, `password`, `real_name`, `phone`, `gender`, `age`, `role_id`, `login_time`, `created_time`, `updated_time`) VALUES (1, 'host', '$2a$10$yF6CSHANWsT9PX1yLQcvt.LqvoVmKx0bHAXCi1aFVXzRWUUqoIyVm', '超级管理员', '13022690933', '1', 25, 1001, '2022-03-08 20:16:11', '2022-02-02 20:04:55', '2022-03-08 20:16:11');
COMMIT;

-- ----------------------------
-- Table structure for tb_work_overtime
-- ----------------------------
DROP TABLE IF EXISTS `tb_work_overtime`;
CREATE TABLE `tb_work_overtime` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `start_time` datetime NOT NULL COMMENT '加班开始时间',
  `end_time` datetime NOT NULL COMMENT '加班结束时间',
  `year` int NOT NULL COMMENT '年份',
  `days` decimal(3,1) NOT NULL COMMENT '加班天数',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `updated_time` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `user_id` (`user_id`) USING BTREE,
  KEY `user_id_year` (`user_id`,`year`) USING BTREE,
  KEY `userid_start_end` (`user_id`,`start_time`,`end_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='加班记录表';


SET FOREIGN_KEY_CHECKS = 1;
